<template>
  <div>
    <el-container style="height: 910px;">
      <el-aside width="200px">
        <asider></asider>
      </el-aside>
      <el-main v-if="$store.state.commons.isadmined">
        <nuxt class="body" />
      </el-main>
    </el-container>
  </div>
</template>
<script>
import asider from "@/components/admin/aside.vue";
export default {
  components: { asider },
  mounted() {
    let is = this.$store.state.commons.isadmined;
    if (is != "" || is != null) {
      if (is == "0") {
        alert(JSON.stringify(this.$store.state.commons));
        this.$router.push("/admin");
      }
    } else {
      window.onNuxtReady(() => {
        is = this.$store.state.commons.isadmined;
        if (is == "0") {
          this.$router.push("/admin");
        }
      });
    }
  },
  data() {
    return {
      dialogVisible: true,
      form: {}
    };
  },
  methods: {
    check() {
      if (
        this.form.username == null ||
        this.form.username == "" ||
        this.form.password == null ||
        this.form.password == ""
      ) {
        this.$message.error("请填写完整数据！");
        return false;
      }
      return true;
    }
  }
};
</script>
<style lang="less">
.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
}
</style>